#include <iostream>
#include <cstdio>
#include <cstring>
#include <assert.h>

int main (void)
{

    uint8_t exp_ = 0x89;
    uint8_t b0_ = 0xb5;
    uint8_t b1_ = 0x8a;
    uint8_t b2_ = 0xe0;

    printf (" exp 0x%x, exp - 1 0x%x, B0 0x%x, B1 0x%x, B2 0x%x, %s(%i)\n",
        exp_, exp_ - 0x1, b0_, b1_, b2_, __FILE__, __LINE__);

    //  Make sure that float has 4B.
    assert (sizeof (float) == 4);

    //  Store sign.
    bool sign = b0_ & 0x80;
    b0_ &= 0x7f;
    float pc_float = 0;

    //  Probably not fitting with logger doc.
    if (exp_ != 0 || b2_ != 0 || b1_ != 0 || b0_ != 0) {
        uint32_t buff =  b2_ | b1_ << 8 | b0_ << 16 | (exp_ - 0x1) << 23 | sign << 31;
        memcpy (&pc_float, &buff, sizeof (float));
    }

    printf ("float format %.13f, %s(%i)\n", pc_float, __FILE__, __LINE__);

    return 0;
}
